package Utils;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URLDecoder;
import java.util.Date;

import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;

public class Test {
	public static void main(String[] args) throws ClientProtocolException, IOException {
		System.out.println(new Date(1450928535).toLocaleString());
		System.out.printf("%-3d aaa\n",1564687);
		String c = URLDecoder.decode("\u591a\u6b21\u5e7f\u544a\u7b49\u5783\u573e\u4fe1\u606f\u5bfc\u81f4\u4f60\u7684\u5e10\u53f7\u88ab\u6c38\u4e45\u7981\u8a00");
		System.out.println(c);
	}
	
	
	public static void f() throws UnsupportedEncodingException, UnsupportedOperationException, IOException	 {
		HttpClientBuilder hcb = HttpClients.custom()
        		.setProxy(new HttpHost("127.0.0.1",9999));
        
        CloseableHttpClient httpclient = hcb.build();
        HttpGet hg = new HttpGet("http://www.baidu.com");
        int i =0;
		while (true) {
			CloseableHttpResponse response = httpclient.execute(hg);
			HttpEntity entity = response.getEntity();
			BufferedReader br = new BufferedReader(new InputStreamReader(
					entity.getContent(), "utf-8"));
			String con = null;
			System.out.println(i++);
			try {
			} finally {
				br.close();
			}
		}
	}
}
